<?php

// $Id$

require_once($WSC->get_site_inc_dir().'modules/admin_panel/site_admin_ajax_grid_ctrl_ua.class.php');
require_once('ci_attachments_grid_ctrl.class.php');


class CI_Attachments_Grid_Ajax_Ctrl extends Site_Admin_Ajax_Grid_Ctrl_UA {
	protected function init_transit_vars() {
		$this->add_transit_var('vpage');
		$this->add_transit_var('category');
		$this->add_transit_var('ci');
	}


	protected function create_grid_ctrl() {
		$tvm = $this->get_tvm();

		$context = $this->get__context();
		if (!$context->exists_in_get('ci')) {
			throw new Tangra_Module_Exception('Expecting ci parameter.');
		}

		$ret = new CI_Attachments_Grid_Ctrl('ci_attachments', $tvm, Tangra_Parameter_Method::GET, $context->get_from_get('ci'));
		$ret->set_additional_parameters(array('ci' => $context->get_from_get('ci')));

		return $ret;
	}
}